<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>操作日志</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <!-- load css -->
    <link rel="stylesheet" th:href="@{/css/font.css}" />
    <link rel="stylesheet" th:href="@{/css/xadmin.css}" />
    <script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>
</head>
<body class="layui-anim layui-anim-fadein">
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a>管理员</a>
        <a><cite>操作日志</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <div class="layui-form layui-col-md12 x-so">
            <input id="user_name" type="text" name="user_name"  placeholder="用户名" autocomplete="off" class="layui-input">
            <input id="ip" type="text" name="ip"  placeholder="ip" autocomplete="off" class="layui-input">
            <button id="searchBtn" data-type="reload" class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </div>
    </div>
    <table class="layui-hide" id="table1" lay-filter="tool1"></table>
</div>

<script>

    layui.use(['laydate', 'laypage', 'table'], function(){
        var laydate = layui.laydate,
            table = layui.table,
            laypage = layui.laypage;
        table.render({
            elem: '#table1'
            ,height: 650
            ,limit: 15
            ,limits:[15,20,30,40,50,60,70,80,90]
            ,url: '[[@{/admin/log/list.html}]]' //数据接口
            ,id:'table1'
            ,page: true //开启分页
            ,cols: [
                [
                    {field: 'id', title: 'ID', width:'10%', sort: true, align:'center'}
                    ,{field: 'user_name', title: '用户名',align:'center'}
                    ,{field: 'title', title: '内容', align:'center'}
                    ,{field: 'ip',  title: 'ip'}
                    ,{field: 'create_time', title: '时间', align:'center'}
                    ,{field: 'path', title: '路径', align:'center'}
                ]
            ]
        });

        $('#searchBtn').on('click', function(){
            var index = layer.msg('查询中，请稍候...',{icon: 16,time:false,shade:0});
            table.reload('table1', {
                page: {
                    curr: 1 //重新从第 1 页开始
                }
                ,where: {
                    'user_name': $('#user_name').val(),
                    'ip':$('#ip').val(),
                }
            });
            layer.close(index);
        });

    });
</script>
</body>
</html>
